Skip to content

docs(skills): objectstack-ai teaches the ask_ai action, the Ask AI button on a record - #37372

Merged
os-zhuang merged 2 commits into
mainfrom
claude/project-thread-cfxhbj
Nov 26, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/project-thread-cfxhbj

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread
repo:objectstack#5 · os-bill · session_01Utp6CZfqUFGzpwvVwRfzYS

Fixes #37217

Clause-②: no
Metadata-protocol: none
Skills-docs: this PR is the skills-docs half (skills/objectstack-ai) owed by PR #37215 (Skills-docs: follow-up owed — skills/objectstack-ai/SKILL.md); the ask_ai action itself shipped in PR #37215

维护者速读

  • 用户能看到什么变化:用 AI 搭建应用时,AI 读到的技能说明现在会教「问 AI」按钮怎么放:放在记录页标题栏或更多菜单,点开后助手钉在这条记录上;并说明它不能带目标、不能开放给 AI 当工具、不能放在仪表盘标题,且只在装了应用内助手的版本里出现。只有文字变化。
  • 为什么做:属于「在一条记录上问 AI」专题,补上「问 AI」动作合并后欠下的技能说明。
  • 出错会怎样:最坏是说明写得不准,AI 写出的动作仍会被校验拦住;撤回即恢复旧文字。
  • 要你做什么:受治理的技能文件,需要你批准后合并。

What changes

skills/objectstack-ai/SKILL.md, a new subsection The Ask AI button — type: 'ask_ai' at the end of Actions as AI Tools:

  • What the action does: it pins the assistant's conversation to the record it runs on and opens the assistant, sending no message. It is declared on the object, in locations: ['record_header'] or ['record_more'], with a defineAction example marked os:check (type-checked against the built spec by check:skill-examples).
  • What the parse refuses beside it: a target, ai.exposed: true, and actionType: 'ask_ai' on a dashboard header (a header runs on no record).
  • That nothing serves it headless: list_actions skips it, run_action refuses it, and no action_ tool exists for it.
  • Where it is absent rather than disabled: the console draws it only where the assistant surface is on and the AI service honours a conversation focus.

Paid for by deleting restatement in the same file; the token ceiling is unchanged (6801, the file measures 6787). Deleted: the App AI Blueprint table (its first two rows restate Skill Configuration and the KnowledgeServicePlugin wiring; its third row's claim that agents / tools / skills are the only AI stack collections was stale, since aiContexts is a defineStack key too); the alias sentence under Platform agents (data_chat / metadata_assistant for old bookmarks: the agent type is closed to third parties, so no author writes either); the pointer to references/_index.md for AgentSchema (the References section already points there); the rung-2 sentence "Read that file for the exact set" (the sentence before it names the file); the two product-analogy parentheticals beside ask and build; and the memory clause of pitfall 1, kept to its two facts (the required keys and that there is no storage backend to choose).

evals/skills-tools-knowledge.json:

  • New case 10: "Add an Ask AI button to the contract record page". Expected: a defineAction with type: 'ask_ai', objectName: 'contract', locations: ['record_header'], no target, no ai.exposed: true, with the headless and absent-not-disabled facts. Assertions: must contain ask_ai, record_header, locations; must not contain target: (only that token: a correct answer may well spell exposed: true or actionType while stating the refusals, so neither can be forbidden under the grader's literal-substring rule).
  • Case 9 (declared extra item, same kind of edit in the same file, asked for in the contract review): its reference answer no longer spells the chunkSize token it forbids (it now says "no chunk-size key"); the assertions are unchanged.

Changeset .changeset/37217-skill-ask-ai-action.md: @objectstack/skills patch, carrying the two declaration lines.

Out of scope, left where it lives: the objectstack-ui action-type row (landed in PR #37215); the ai_context teaching (#37177, same skill tree, unclaimed until this lands).

Why

PR #37215 (#37142) added the ask_ai action type and its console executor, and declared Skills-docs: follow-up owed — skills/objectstack-ai/SKILL.md. The UI skill's action-type table has the row; the AI skill, the one an author reads when wiring the assistant, did not mention the action, so an agent asked for an Ask AI button would reach for ai.exposed: true or a target, both refused at parse.

Verification

Every claim in the new passage rests on main at 98bda0a: packages/spec/src/ui/action.zod.ts (ActionType carries ask_ai; TARGETLESS_TYPES; refuseAskAiContradictions refuses target and ai.exposed: true), packages/spec/src/ui/dashboard.zod.ts (refuseRecordlessAskAi on the header action), packages/runtime/src/action-execution.ts (isHeadlessInvokableAction answers false; the door's ask_ai sentence), ui/packages/app-shell/src/hooks/useAiSurface.ts (enabled + focusServed, capabilities.focus) and useAskAiHandler.ts, docs/adr/0160-record-scoped-ai-inquiry.md D7, and examples/app-showcase/src/ui/actions/index.ts (showcase_ask_about_task, the same shape as the example).

Skills size readings (node scripts/check-skills-token-ratchet.mjs, tokens = ceil(utf8 bytes / 4)):

main this PR
skills/objectstack-ai/SKILL.md lines 474 485
skills/objectstack-ai/SKILL.md tokens (ceiling 6801) 6800 6787
All skills/*/SKILL.md lines 4948 4959
Bundle total tokens (whole shipped tree) 297305 297523

The bundle grows by 218 tokens: +231 in the unratcheted eval fixture (2444 to 2675), −13 in ratcheted authored text.

Rework at 05555e0 (contract review 7178774511, PASS with two should-fixes and a nit): the changeset's token count reads 6787 (measured), the Blueprint-row reason says stale rather than restated, case 10's must_not_contain keeps only target:, and case 9's reference drops the literal chunkSize. The grader the cases declare (packages/qa/scenarios/src/skill-evals/grade.ts, gradeAnswer) run over each case's own expected_output:

== head e16ec49d (before the fix) ==
case 9: pass=false missing=[] forbidden=["chunkSize"]
case 10: pass=false missing=[] forbidden=["exposed: true"]
== head 05555e04 (after the fix) ==
case 9: pass=true missing=[] forbidden=[]
case 10: pass=true missing=[] forbidden=[]

Re-run on the new head: check-skills-token-ratchet (6787/6801), check-empty-changeset, check-changeset-no-major, check:nul-bytes, all exit 0; check-commit-card-trailers --range origin/main..HEAD exit 0 (2 commits); overlap-check --branch=HEAD VERDICT clean. The skill file is byte-identical to e16ec49, so the gates below still describe it.

Local gates at e16ec49

node scripts/pm/dispatch-gates.mjs --commands derived 49 commands (run from the committed head, reconciled with --ran: 49 derived, 48 run, 1 NOT-MEASURED, 0 UNRUN). 48 ran locally, all exit 0, including check-skills-token-ratchet (gate and --self-test), @objectstack/spec check:skill-docs, check:skill-links, check:skill-identifier-liveness, check:skill-compatibility, check:skill-frame-sync, check:doc-authoring, check:corpus-claim-drift, check:nul-bytes, check:role-word, check-empty-changeset, check-changeset-no-major, check-adr-0087-registration, check:pm-governed-merges, check:published-files, check:dts-closure, check:lean-entry-closure, @objectstack/lint check:doc-formula-expressions.

NOT MEASURED locally, left to CI: check:dual-build-cjs-loads (exit 3, prerequisite: reads every package's built dist; only spec, client, client-react and their closure were built here). The diff touches no package source.

Outside the derived set, run because the card's acceptance names it: @objectstack/spec check:skill-examples exit 0 — 351 marked examples across 3 surfaces type-check, the new os:check block included (tsc ran the semantic pass on all of them, against the built @objectstack/spec).

Pre-push: check-commit-card-trailers --range origin/main..HEAD exit 0; overlap-check --branch=HEAD VERDICT clean (origin/main and the one open PR sharing skills/objectstack-ai/SKILL.md, #35129, both merge cleanly).

No ablation: the change is docs and an eval fixture; no tested behaviour moved.

Two-minute check: read The Ask AI button in skills/objectstack-ai/SKILL.md beside refuseAskAiContradictions in packages/spec/src/ui/action.zod.ts and D7 of ADR-0160.

Acceptance notes

  • Built by the card thread itself on claude-fable-5-1 under the measured-unavailability exemption recorded in the claim (comment 7177961994: dispatch-gates --tier mandates claude-fable-5-2 for skills/**; this account serves 5-1). The compensating control is the contract review at CONTRACT_REVIEW_TIER, owed on the handoff.
  • None filed.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (repo-wide lint is CI's run; the diff touches only Markdown and JSON)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CZfqUFGzpwvVwRfzYS

…tton on a record

The AI skill now has a subsection under Actions as AI Tools for
`type: 'ask_ai'`: what the action does (pins the assistant's conversation
to the record it runs on and opens it, sending no message), where it is
declared (`locations: ['record_header']` or `['record_more']`, with a
`defineAction` example that type-checks against the spec), what the parse
refuses beside it (`target`, `ai.exposed: true`, a dashboard header
`actionType: 'ask_ai'`), that nothing serves it headless (`list_actions`
skips it, `run_action` refuses it, no `action_` tool), and that the
console draws it only where the assistant surface is on and the AI
service honours a conversation focus.

Paid for by deleting restatement in the same file; the token ceiling is
unchanged (6801; the file measures 6786). A new eval case asks for an
Ask AI button on the contract record page.

Claude-Session: https://claude.ai/code/session_01Utp6CZfqUFGzpwvVwRfzYS
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head e16ec49 · 2026-11-26T00:22Z

The seat runs the at-tier contract review of this head through an isolated sub-agent; L1 is the seat's own.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: e16ec49dab9170e5a89262a26c9f22eb37231628
Local-runs: probe — hand audit of the token count the changeset and PR body disagree on (wc -c on git show of the skill file at main and at the head, by the formula the ratchet script documents), and a JSON parse of the eval fixture; no gate, build or test was run
Scope: skills/objectstack-ai/SKILL.md, skills/objectstack-ai/evals/skills-tools-knowledge.json + .changeset/37217-skill-ask-ai-action.md
Security-touching: yes
Rule-change-verified: none

PR #37372, card #37217. Net diff against main (merge-base 98bda0a; main has not moved under skills/objectstack-ai/**, the ratchet script, or the two spec files the passage cites). Three files: the skill, one eval fixture, one changeset. No package source.

① Derived judgments

  • Public surface. One published skill file gains a subsection and loses restatement; one eval fixture gains a case. No schema, no accept-set, no runtime behaviour changes. Right: the ask_ai member and its refusals shipped in PR feat(spec,console): ask_ai action type — focus the in-app assistant on a record #37215, and this PR only teaches them.
  • Every sentence of the new subsection, against main:
    • "Pins the assistant's conversation to the record the action runs on and opens it, sending no message" holds. ADR-0160 D7 (Executor); ui/packages/app-shell/src/hooks/useAskAiHandler.ts opens the drawer and calls setChatFocus, and sends nothing.
    • "Declare it on the object, in record_header or record_more" holds. Both are ActionLocationSchema members, and the dashboard refusal message in packages/spec/src/ui/dashboard.zod.ts names the same two.
    • The example (defineAction, type: 'ask_ai', objectName, locations: ['record_header'], no target) has the shape of showcase_ask_about_task in examples/app-showcase/src/ui/actions/index.ts. ask_ai is in TARGETLESS_TYPES, so no target is owed.
    • "the parse refuses a target, ai.exposed: true" holds: refuseAskAiContradictions in packages/spec/src/ui/action.zod.ts, applied on both action shapes.
    • "and actionType: 'ask_ai' on a dashboard header (a header runs on no record)" holds: refuseRecordlessAskAi.
    • "list_actions skips it, run_action refuses it, and no action_ tool exists for it" holds. isHeadlessInvokableAction in packages/runtime/src/action-execution.ts answers false for it, the door has its own ask_ai refusal sentence, and ai.exposed: true cannot parse, so the action_ family never materialises it (D7, Never an AI tool).
    • "drawn only where the assistant surface is on and the AI service honours a conversation focus; elsewhere absent, not disabled" holds: D7 (Absent without an in-app assistant), useAiSurface.ts (enabled, focusServed), and useAskAiHandler returning undefined.
    • The ☁️ on the heading is consistent with the file's edition note: the spec member is open, the button is drawn only by the in-app assistant.
  • Deletions: nothing true and load-bearing is lost.
    • App AI Blueprint table. Rows 1 and 2 restate Skill Configuration and the KnowledgeServicePlugin({ sources }) wiring, both still present. Row 3 said "agents / tools / skills are the only AI stack collections", which is no longer true on main (aiContexts is a defineStack key), so removing it removes a stale claim. Skill registration stays taught in objectstack-platform (the skills stack key and the generator barrel). No anchor link to the section exists anywhere in the tree.
    • Alias sentence (data_chat, metadata_assistant). Neither name appears in packages/spec or packages/runtime on main; no author writes them.
    • The _index.md pointer for AgentSchema: the References section still points there.
    • Rung-2 tail sentence: the file path is still named in the same rung.
    • The two product-analogy parentheticals: no contract content.
    • Pitfall 1 memory clause: both facts kept (the two required keys, no storage backend to choose); "no gate" kept.
  • Check-runs on the head. Every run concluded success or skipped; none failed. Check Changeset, Lint · docs & code guards, Lint · repo & tooling gates, Governed Surface Queue Guard and PR-body guards are green. No name carries two conflicting conclusions.
  • Security-touching: yes, kept deliberately. The new hunk teaches an AI-exposure refusal (ai.exposed: true on this type), and the pitfall 1 hunk edits the paragraph on enforced gates. Both hunks are accurate; the line only keeps the PR at maintainer approval, which the PR body already asks for.
  • Rule-change-verified: none: the diff touches no .claude/** path and changes nothing an agent may do without the maintainer.

② Semver level

@objectstack/skills patch, Clause-②: no, Metadata-protocol: none, the same two lines on the PR body and in the changeset. Right: skill wording and an eval fixture only, and the protocol addition was declared by PR #37215.

Ratchet claim: the ceiling row for skills/objectstack-ai/SKILL.md is 6801 and is untouched by the diff. Hand audit by the script's documented formula (bytes minus the 20-byte stamp line, divided by 4, rounded up): 6800 on main, 6787 at the head. That matches the PR body and the dev report, and the file is under its ceiling with 14 to spare.

  • should-fix. The changeset says "the file now measures 6786". The head measures 6787. The changeset text becomes the published changelog entry; correct the number.

③ Boundary flags

  • open_questions: empty. Nothing to answer.
  • Deviation, built in the thread's own checkout instead of a separate worktree: accepted. It is one branch and one PR, and the diff is three files inside the claimed file surface.
  • Deviation, built on claude-fable-5-1 under the measured-unavailability exemption in claim comment 7177961994: the compensating control it names is this review at CONTRACT_REVIEW_TIER. Rendered here.
  • Deviation, commit trailer shape: check-commit-card-trailers is the judge, and the lint check-runs are green.
  • Out-of-scope notes (the ai_context teaching stays on 37140 跟进:技能文档教作者写资料包(ai_context) #37177; the objectstack-ui row already landed): both correct, nothing owed here.
  • The card's acceptance says an eval prompt "yields a valid action". The case was added, and its expected answer is the type-checked example's shape; the eval itself was not run. Accepted for a fixture, with the finding in ④.
  • SQL push-down: not applicable. The diff holds no code, no query and no id materialisation.
  • Token ceiling: the row was not raised, so the enumeration-row exception in the claim was not used.

④ Design judgment

skills/objectstack-ai/SKILL.md: holds against the spec on main and against the card's four points (what it does, what the parse refuses, where it is absent, never headless). An agent given the card's prompt and this text writes an action that parses. No must-fix.

  • nit. The PR body and changeset say the third Blueprint row "restates the defineStack note". The file has no such note for skills; the row was stale, not restated. The deletion is still right; only the stated reason is loose.

skills/objectstack-ai/evals/skills-tools-knowledge.json, case 10: well-formed (parses; same five keys as cases 1 to 9; id unique), and its three must_contain tokens are all taught by the new subsection.

  • should-fix. The grader (packages/qa/scenarios/src/skill-evals/grade.ts) matches each token as a literal substring of the whole answer. Case 10's own expected_output contains exposed: true, which is in its must_not_contain, so an answer that states the refusal the way the expected answer does is graded a failure. actionType has the same problem: an answer that repeats the skill's dashboard-header sentence fails. Case 9 on main has the same flaw with chunkSize, so this follows precedent and does not block; drop exposed: true and actionType from must_not_contain, or keep only tokens a correct answer cannot contain.

.changeset/37217-skill-ask-ai-action.md: accurate except the count in ②.

Implemented-by: claude/project-thread-cfxhbj
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: e16ec49dab
REWORK — L1, seat repo:objectstack#5: the two should-fix findings of contract record 7178774511 must be fixed in this PR before handoff. The rest of L1 reads clean.

  1. Shape: open draft against main, 3 files (+70/−23). The first line is Fixes #37217. This PR is the skills-docs half owed by PR feat(spec,console): ask_ai action type — focus the in-app assistant on a record #37215. l1-face CLEAN, 13 items.
  2. Premise: per the record, every sentence of the new "Ask AI button" subsection holds against main: the action schema, the dashboard-header refusal, the headless predicate, the console handler, and ADR-0160 D7. Nothing true and load-bearing was deleted.
  3. Owed in this PR:
    • S1: the changeset says the file "now measures 6786", but the head measures 6787 against ceiling 6801. That text becomes the published changelog, so fix it.
    • S2: eval case 10 fails its own reference answer. Its expected_output carries exposed: true, which is listed in must_not_contain, and actionType trips the same check for any answer that repeats the skill's dashboard-header sentence. Reword the expected output, or narrow must_not_contain to the wrong forms. Then run the grader against the reference answer once and quote its output. Case 9's identical chunkSize flaw on main is a follow-up, not owed here.
      The same reviewer reads the delta.
  4. Accepted deviations: the nit "restates the defineStack note" should read "was stale" (aiContexts exists). It may ride along with the fix.
  5. Landing terms: Tier H (skills/**), built on fable-5-1 under the exemption, with this contract-tier L2 as the compensating control. Approval is needed because the record marks it Security-touching: yes. After a same-head at-tier PASS with S1 and S2 closed, and an ACCEPT, the seat hands it to os-zhuang + hotlong.

The changeset states the measured token count (6787) and says why the
Blueprint row was stale rather than restated. Eval case 10's
must_not_contain keeps only `target:`, a token a correct answer never
carries, and case 9's reference answer no longer spells the `chunkSize`
token it forbids, so both references pass the grader they declare.

Claude-Session: https://claude.ai/code/session_01Utp6CZfqUFGzpwvVwRfzYS
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 05555e0 · 2026-11-26T00:48Z

The seat runs the at-tier contract review of this head through an isolated sub-agent; L1 is the seat's own.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 05555e04f3298c989234451bc030e19ab3361236
Local-runs: probe — the PR body quotes grader output for cases 9 and 10, so the grader's rule (literal substring, read from its source) was re-applied by hand to every case's own reference answer at both heads; plus the earlier hand audit of the token count by the ratchet's documented formula. No gate, build or test was run
Scope: skills/objectstack-ai/SKILL.md, skills/objectstack-ai/evals/skills-tools-knowledge.json + .changeset/37217-skill-ask-ai-action.md
Security-touching: yes
Rule-change-verified: none

PR #37372, card #37217. This record replaces the one on head e16ec49. The delta from that head is one commit touching two files, the changeset and the eval fixture. skills/objectstack-ai/SKILL.md is byte-identical to e16ec49 (it is absent from git diff e16ec49d 05555e04), so the sentence-by-sentence reading below was done on the same bytes.

① Derived judgments

  • Public surface. One published skill file gains a subsection and loses restatement; one eval fixture gains a case and has one reference answer reworded. No schema, no accept-set, no runtime behaviour changes. Right: the ask_ai member and its refusals shipped in PR feat(spec,console): ask_ai action type — focus the in-app assistant on a record #37215, and this PR only teaches them.
  • Every sentence of the new subsection, against main:
    • "Pins the assistant's conversation to the record the action runs on and opens it, sending no message" holds. ADR-0160 D7 (Executor); ui/packages/app-shell/src/hooks/useAskAiHandler.ts opens the drawer and calls setChatFocus, and sends nothing.
    • "Declare it on the object, in record_header or record_more" holds. Both are ActionLocationSchema members, and the dashboard refusal message in packages/spec/src/ui/dashboard.zod.ts names the same two.
    • The example (defineAction, type: 'ask_ai', objectName, locations: ['record_header'], no target) has the shape of showcase_ask_about_task in examples/app-showcase/src/ui/actions/index.ts. ask_ai is in TARGETLESS_TYPES, so no target is owed.
    • "the parse refuses a target, ai.exposed: true" holds: refuseAskAiContradictions in packages/spec/src/ui/action.zod.ts, applied on both action shapes.
    • "and actionType: 'ask_ai' on a dashboard header (a header runs on no record)" holds: refuseRecordlessAskAi.
    • "list_actions skips it, run_action refuses it, and no action_ tool exists for it" holds. isHeadlessInvokableAction in packages/runtime/src/action-execution.ts answers false for it, the door has its own ask_ai refusal sentence, and ai.exposed: true cannot parse, so the action_ family never materialises it (D7, Never an AI tool).
    • "drawn only where the assistant surface is on and the AI service honours a conversation focus; elsewhere absent, not disabled" holds: D7 (Absent without an in-app assistant), useAiSurface.ts (enabled, focusServed), and useAskAiHandler returning undefined.
  • Deletions: nothing true and load-bearing is lost.
    • App AI Blueprint table. Rows 1 and 2 restate Skill Configuration and the KnowledgeServicePlugin({ sources }) wiring, both still present. Row 3 said "agents / tools / skills are the only AI stack collections", which is no longer true on main (aiContexts is a defineStack key). Skill registration stays taught in objectstack-platform. No anchor link to the section exists in the tree.
    • Alias sentence (data_chat, metadata_assistant): neither name appears in packages/spec or packages/runtime on main.
    • The _index.md pointer for AgentSchema: the References section still points there.
    • Rung-2 tail sentence, the two product-analogy parentheticals, the pitfall 1 memory clause: no contract content lost; both memory facts and "no gate" are kept.
  • Check-runs on 05555e0. Every run concluded success or skipped; none failed. Four names appear twice (Check Changeset, PR-body guards, Check PR Size, Auto Label). The newer Check Changeset and PR-body guards are success; the newer Check PR Size and Auto Label are skipped, with their earlier runs on this head success. Lint · docs & code guards, Lint · repo & tooling gates and Governed Surface Queue Guard are green.
  • Security-touching: yes, kept deliberately. The new hunk teaches an AI-exposure refusal (ai.exposed: true on this type), and the pitfall 1 hunk edits the paragraph on enforced gates. Both are accurate; the line only keeps the PR at maintainer approval, which the PR body already asks for.
  • Rule-change-verified: none: the diff touches no .claude/** path and changes nothing an agent may do without the maintainer.

② Semver level

@objectstack/skills patch, Clause-②: no, Metadata-protocol: none, the same two lines on the PR body and in the changeset. Right: skill wording and an eval fixture only.

Ratchet: the ceiling row for skills/objectstack-ai/SKILL.md is 6801 and is untouched. The file measures 6787 (6800 on main) by the script's documented formula.

  • Earlier should-fix, closed. The changeset now reads "the file now measures 6787", matching the measurement, the PR body and the dev report.
  • Earlier nit, closed. The changeset and PR body now give the third Blueprint row's reason as stale, not restated, and name aiContexts. That is what main shows.

③ Boundary flags

  • open_questions: empty. Nothing to answer.
  • Deviation, built in the thread's own checkout instead of a separate worktree: accepted. One branch, one PR, three files.
  • Deviation, built on claude-fable-5-1 under the measured-unavailability exemption in claim comment 7177961994: the compensating control it names is this review at CONTRACT_REVIEW_TIER. Rendered here.
  • Deviation, commit trailer shape: check-commit-card-trailers is the judge, and the lint check-runs are green.
  • Case 9 as a declared extra: within scope, accepted. The claim's file surface names the eval fixtures "for ask_ai", and case 9 is the knowledge-split case, so read strictly it sits outside. It is accepted because it is one phrase in the same file ("no chunkSize" became "no chunk-size key"), the meaning is unchanged, the assertions are untouched, and both the PR body and the changeset declare it. Splitting it out would cost a card for a one-phrase edit.
  • Out-of-scope notes (the ai_context teaching stays on 37140 跟进:技能文档教作者写资料包(ai_context) #37177; the objectstack-ui row already landed): both correct.
  • SQL push-down: not applicable. The diff holds no code, no query and no id materialisation.
  • Token ceiling: the row was not raised, so the enumeration-row exception in the claim was not used.

④ Design judgment

skills/objectstack-ai/SKILL.md: holds against the spec on main and against the card's four points. An agent given the card's prompt and this text writes an action that parses. No must-fix.

skills/objectstack-ai/evals/skills-tools-knowledge.json:

  • Earlier should-fix, closed. Case 10's must_not_contain is now ["target:"], and its reference answer no longer carries a forbidden token. Case 9's reference no longer spells chunkSize.
  • The quoted grader output is credible. gradeAnswer in packages/qa/scenarios/src/skill-evals/grade.ts is two String.includes filters. Applying the same rule to each case's expected_output reproduces the PR body exactly: at e16ec49 case 9 carries chunkSize and case 10 carries exposed: true (and only that one of its three forbidden tokens); at 05555e0 all ten cases have nothing missing and nothing forbidden.
  • nit. Case 10 lost some teeth. It no longer fails an answer that writes ai: { exposed: true } on an ask_ai action, one of the two wrong forms the PR's own "Why" names. That is the honest price of a literal-substring grader, which cannot tell the key in code from the same words in a sentence stating the refusal. What remains still does work: target: catches the other wrong form, and must_contain: ask_ai fails the commoner wrong answer, an exposed script action. No change asked.
  • nit. The PR body says the case 9 edit was "asked for in the contract review". The earlier record named case 9 as precedent with the same flaw; it did not ask for the fix. The edit is welcome either way.

.changeset/37217-skill-ask-ai-action.md: accurate, including the new sentences on case 10 and case 9.

Implemented-by: claude/project-thread-cfxhbj
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

维护者速读

  • 改了什么:AI 技能文档新增「Ask AI 按钮(type: 'ask_ai')」一节,教 AI 生成记录页上的「问 AI」动作(PR feat(spec,console): ask_ai action type — focus the in-app assistant on a record #37215 已上线该动作类型),并写明它不是 AI 工具、不能放在仪表盘页头。同时删掉一条过时的 Blueprint 行腾出字数,新增一条评测用例,并顺手修好用例 9 的同类评分缺陷。
  • 为什么:动作已经上线,但技能文档没教,AI 不会生成或会写错(例如误加 ai.exposed)。
  • 风险:只改文档和评测样例,不改代码。技能文件 6787 字,上限 6801 未动。
  • 要你做什么:批准合并。契约复核 PASS 在评论 7179171552,Head-sha 05555e04f3298c989234451bc030e19ab3361236。

席位意见:ACCEPT。新段落逐句对得上 main 的代码和 ADR-0160 D7,首轮两条 should-fix 已修,delta 复核无必改项。

席位核对

Head-sha: 05555e04f3298c989234451bc030e19ab3361236
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: open draft against main, 3 files. Fixes #37217; merging delivers the card, and this is the skills-docs half PR feat(spec,console): ask_ai action type — focus the in-app assistant on a record #37215 owed. l1-face CLEAN on the first head. The delta touches only the changeset and the eval JSON, and the skill file is byte-identical to e16ec49d.
  2. Rework closed:
    • S1: the changeset now says 6787.
    • S2: case 10's must_not_contain is ["target:"], so the reference answer passes. The grader output quoted in the body reproduces from gradeAnswer's two includes filters: all ten cases now have nothing missing and nothing forbidden.
    • The Blueprint-row nit now says "stale".
  3. Gates: every check-run at 05555e04 is success or skipped; none failed. Where a name repeats, the newer run governs.
  4. Accepted deviations:
    • (a) The case 9 reference fix is a declared extra in the same file, with its assertions unchanged.
    • (b) Contract nits: case 10 no longer fails ai: { exposed: true } on an ask_ai action, which is the limit of a literal-substring grader. target: and must_contain: ask_ai still catch the other wrong forms. Separately, the body says the case 9 fix was asked for by the review; it was only named there as precedent.
  5. Out of scope: none.
  6. Landing terms: Tier H (skills/**), whole PR. L2 at CONTRACT_REVIEW_TIER: PASS, comment 7179171552, same head, no must-fix, no should-fix. Security-touching: yes: it teaches an AI-exposure refusal; the security label goes on. Built at fable-5-1 under the exemption; this contract-tier L2 is the compensating control. It waits for the approver, and the seat lands it after approval (ready, auto-merge, queue).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 05555e04f3298c989234451bc030e19ab3361236
Local-runs: probe — the PR body quotes grader output for cases 9 and 10, so the grader's rule (literal substring, read from its source) was re-applied by hand to every case's own reference answer at both heads; plus the earlier hand audit of the token count by the ratchet's documented formula. No gate, build or test was run
Scope: skills/objectstack-ai/SKILL.md, skills/objectstack-ai/evals/skills-tools-knowledge.json + .changeset/37217-skill-ask-ai-action.md
Security-touching: yes
Rule-change-verified: none

PR #37372, card #37217. This record replaces the one on head e16ec49. The delta from that head is one commit touching two files, the changeset and the eval fixture. skills/objectstack-ai/SKILL.md is byte-identical to e16ec49 (it is absent from git diff e16ec49d 05555e04), so the sentence-by-sentence reading below was done on the same bytes.

① Derived judgments

  • Public surface. One published skill file gains a subsection and loses restatement; one eval fixture gains a case and has one reference answer reworded. No schema, no accept-set, no runtime behaviour changes. Right: the ask_ai member and its refusals shipped in PR feat(spec,console): ask_ai action type — focus the in-app assistant on a record #37215, and this PR only teaches them.
  • Every sentence of the new subsection, against main:
    • "Pins the assistant's conversation to the record the action runs on and opens it, sending no message" holds. ADR-0160 D7 (Executor); ui/packages/app-shell/src/hooks/useAskAiHandler.ts opens the drawer and calls setChatFocus, and sends nothing.
    • "Declare it on the object, in record_header or record_more" holds. Both are ActionLocationSchema members, and the dashboard refusal message in packages/spec/src/ui/dashboard.zod.ts names the same two.
    • The example (defineAction, type: 'ask_ai', objectName, locations: ['record_header'], no target) has the shape of showcase_ask_about_task in examples/app-showcase/src/ui/actions/index.ts. ask_ai is in TARGETLESS_TYPES, so no target is owed.
    • "the parse refuses a target, ai.exposed: true" holds: refuseAskAiContradictions in packages/spec/src/ui/action.zod.ts, applied on both action shapes.
    • "and actionType: 'ask_ai' on a dashboard header (a header runs on no record)" holds: refuseRecordlessAskAi.
    • "list_actions skips it, run_action refuses it, and no action_ tool exists for it" holds. isHeadlessInvokableAction in packages/runtime/src/action-execution.ts answers false for it, the door has its own ask_ai refusal sentence, and ai.exposed: true cannot parse, so the action_ family never materialises it (D7, Never an AI tool).
    • "drawn only where the assistant surface is on and the AI service honours a conversation focus; elsewhere absent, not disabled" holds: D7 (Absent without an in-app assistant), useAiSurface.ts (enabled, focusServed), and useAskAiHandler returning undefined.
  • Deletions: nothing true and load-bearing is lost.
    • App AI Blueprint table. Rows 1 and 2 restate Skill Configuration and the KnowledgeServicePlugin({ sources }) wiring, both still present. Row 3 said "agents / tools / skills are the only AI stack collections", which is no longer true on main (aiContexts is a defineStack key). Skill registration stays taught in objectstack-platform. No anchor link to the section exists in the tree.
    • Alias sentence (data_chat, metadata_assistant): neither name appears in packages/spec or packages/runtime on main.
    • The _index.md pointer for AgentSchema: the References section still points there.
    • Rung-2 tail sentence, the two product-analogy parentheticals, the pitfall 1 memory clause: no contract content lost; both memory facts and "no gate" are kept.
  • Check-runs on 05555e0. Every run concluded success or skipped; none failed. Four names appear twice (Check Changeset, PR-body guards, Check PR Size, Auto Label). The newer Check Changeset and PR-body guards are success; the newer Check PR Size and Auto Label are skipped, with their earlier runs on this head success. Lint · docs & code guards, Lint · repo & tooling gates and Governed Surface Queue Guard are green.
  • Security-touching: yes, kept deliberately. The new hunk teaches an AI-exposure refusal (ai.exposed: true on this type), and the pitfall 1 hunk edits the paragraph on enforced gates. Both are accurate; the line only keeps the PR at maintainer approval, which the PR body already asks for.
  • Rule-change-verified: none: the diff touches no .claude/** path and changes nothing an agent may do without the maintainer.

② Semver level

@objectstack/skills patch, Clause-②: no, Metadata-protocol: none, the same two lines on the PR body and in the changeset. Right: skill wording and an eval fixture only.

Ratchet: the ceiling row for skills/objectstack-ai/SKILL.md is 6801 and is untouched. The file measures 6787 (6800 on main) by the script's documented formula.

  • S1 (should-fix): closed. The changeset now reads "the file now measures 6787", matching the measurement, the PR body and the dev report.
  • Earlier nit, closed. The changeset and PR body now give the third Blueprint row's reason as stale, not restated, and name aiContexts. That is what main shows.

③ Boundary flags

  • open_questions: empty. Nothing to answer.
  • Deviation, built in the thread's own checkout instead of a separate worktree: accepted. One branch, one PR, three files.
  • Deviation, built on claude-fable-5-1 under the measured-unavailability exemption in claim comment 7177961994: the compensating control it names is this review at CONTRACT_REVIEW_TIER. Rendered here.
  • Deviation, commit trailer shape: check-commit-card-trailers is the judge, and the lint check-runs are green.
  • Case 9 as a declared extra: within scope, accepted. The claim's file surface names the eval fixtures "for ask_ai", and case 9 is the knowledge-split case, so read strictly it sits outside. It is accepted because it is one phrase in the same file ("no chunkSize" became "no chunk-size key"), the meaning is unchanged, the assertions are untouched, and both the PR body and the changeset declare it. Splitting it out would cost a card for a one-phrase edit.
  • Out-of-scope notes (the ai_context teaching stays on 37140 跟进:技能文档教作者写资料包(ai_context) #37177; the objectstack-ui row already landed): both correct.
  • SQL push-down: not applicable. The diff holds no code, no query and no id materialisation.
  • Token ceiling: the row was not raised, so the enumeration-row exception in the claim was not used.

④ Design judgment

skills/objectstack-ai/SKILL.md: holds against the spec on main and against the card's four points. An agent given the card's prompt and this text writes an action that parses. No must-fix.

skills/objectstack-ai/evals/skills-tools-knowledge.json:

  • S2 (should-fix): closed. Case 10's must_not_contain is now ["target:"], and its reference answer no longer carries a forbidden token. Case 9's reference no longer spells chunkSize.
  • The quoted grader output is credible. gradeAnswer in packages/qa/scenarios/src/skill-evals/grade.ts is two String.includes filters. Applying the same rule to each case's expected_output reproduces the PR body exactly: at e16ec49 case 9 carries chunkSize and case 10 carries exposed: true (and only that one of its three forbidden tokens); at 05555e0 all ten cases have nothing missing and nothing forbidden.
  • nit. Case 10 lost some teeth. It no longer fails an answer that writes ai: { exposed: true } on an ask_ai action, one of the two wrong forms the PR's own "Why" names. That is the honest price of a literal-substring grader, which cannot tell the key in code from the same words in a sentence stating the refusal. What remains still does work: target: catches the other wrong form, and must_contain: ask_ai fails the commoner wrong answer, an exposed script action. No change asked.
  • nit. The PR body says the case 9 edit was "asked for in the contract review". The earlier record named case 9 as precedent with the same flaw; it did not ask for the fix. The edit is welcome either way.

.changeset/37217-skill-ask-ai-action.md: accurate, including the new sentences on case 10 and case 9.

Implemented-by: claude/project-thread-cfxhbj
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 05555e04f3298c989234451bc030e19ab3361236
Local-runs: probe — the PR body quotes grader output for cases 9 and 10, so the grader's rule (literal substring, read from its source) was re-applied by hand to every case's own reference answer at both heads; plus the earlier hand audit of the token count by the ratchet's documented formula. No gate, build or test was run
Scope: skills/objectstack-ai/SKILL.md, skills/objectstack-ai/evals/skills-tools-knowledge.json + .changeset/37217-skill-ask-ai-action.md
Security-touching: yes
Rule-change-verified: none

PR #37372, card #37217. This record replaces the one on head e16ec49. The delta from that head is one commit touching two files, the changeset and the eval fixture. skills/objectstack-ai/SKILL.md is byte-identical to e16ec49 (it is absent from git diff e16ec49d 05555e04), so the sentence-by-sentence reading below was done on the same bytes.

① Derived judgments

  • Public surface. One published skill file gains a subsection and loses restatement; one eval fixture gains a case and has one reference answer reworded. No schema, no accept-set, no runtime behaviour changes. Right: the ask_ai member and its refusals shipped in PR feat(spec,console): ask_ai action type — focus the in-app assistant on a record #37215, and this PR only teaches them.
  • Every sentence of the new subsection, against main:
    • "Pins the assistant's conversation to the record the action runs on and opens it, sending no message" holds. ADR-0160 D7 (Executor); ui/packages/app-shell/src/hooks/useAskAiHandler.ts opens the drawer and calls setChatFocus, and sends nothing.
    • "Declare it on the object, in record_header or record_more" holds. Both are ActionLocationSchema members, and the dashboard refusal message in packages/spec/src/ui/dashboard.zod.ts names the same two.
    • The example (defineAction, type: 'ask_ai', objectName, locations: ['record_header'], no target) has the shape of showcase_ask_about_task in examples/app-showcase/src/ui/actions/index.ts. ask_ai is in TARGETLESS_TYPES, so no target is owed.
    • "the parse refuses a target, ai.exposed: true" holds: refuseAskAiContradictions in packages/spec/src/ui/action.zod.ts, applied on both action shapes.
    • "and actionType: 'ask_ai' on a dashboard header (a header runs on no record)" holds: refuseRecordlessAskAi.
    • "list_actions skips it, run_action refuses it, and no action_ tool exists for it" holds. isHeadlessInvokableAction in packages/runtime/src/action-execution.ts answers false for it, the door has its own ask_ai refusal sentence, and ai.exposed: true cannot parse, so the action_ family never materialises it (D7, Never an AI tool).
    • "drawn only where the assistant surface is on and the AI service honours a conversation focus; elsewhere absent, not disabled" holds: D7 (Absent without an in-app assistant), useAiSurface.ts (enabled, focusServed), and useAskAiHandler returning undefined.
  • Deletions: nothing true and load-bearing is lost.
    • App AI Blueprint table. Rows 1 and 2 restate Skill Configuration and the KnowledgeServicePlugin({ sources }) wiring, both still present. Row 3 said "agents / tools / skills are the only AI stack collections", which is no longer true on main (aiContexts is a defineStack key). Skill registration stays taught in objectstack-platform. No anchor link to the section exists in the tree.
    • Alias sentence (data_chat, metadata_assistant): neither name appears in packages/spec or packages/runtime on main.
    • The _index.md pointer for AgentSchema: the References section still points there.
    • Rung-2 tail sentence, the two product-analogy parentheticals, the pitfall 1 memory clause: no contract content lost; both memory facts and "no gate" are kept.
  • Check-runs on 05555e0. Every run concluded success or skipped; none failed. Four names appear twice (Check Changeset, PR-body guards, Check PR Size, Auto Label). The newer Check Changeset and PR-body guards are success; the newer Check PR Size and Auto Label are skipped, with their earlier runs on this head success. Lint · docs & code guards, Lint · repo & tooling gates and Governed Surface Queue Guard are green.
  • Security-touching: yes, kept deliberately. The new hunk teaches an AI-exposure refusal (ai.exposed: true on this type), and the pitfall 1 hunk edits the paragraph on enforced gates. Both are accurate; the line only keeps the PR at maintainer approval, which the PR body already asks for.
  • Rule-change-verified: none: the diff touches no .claude/** path and changes nothing an agent may do without the maintainer.

② Semver level

@objectstack/skills patch, Clause-②: no, Metadata-protocol: none, the same two lines on the PR body and in the changeset. Right: skill wording and an eval fixture only.

Ratchet: the ceiling row for skills/objectstack-ai/SKILL.md is 6801 and is untouched. The file measures 6787 (6800 on main) by the script's documented formula.

  • S1: closed. The changeset now reads "the file now measures 6787", matching the measurement, the PR body and the dev report.
  • Earlier nit, closed. The changeset and PR body now give the third Blueprint row's reason as stale, not restated, and name aiContexts. That is what main shows.

③ Boundary flags

  • open_questions: empty. Nothing to answer.
  • Deviation, built in the thread's own checkout instead of a separate worktree: accepted. One branch, one PR, three files.
  • Deviation, built on claude-fable-5-1 under the measured-unavailability exemption in claim comment 7177961994: the compensating control it names is this review at CONTRACT_REVIEW_TIER. Rendered here.
  • Deviation, commit trailer shape: check-commit-card-trailers is the judge, and the lint check-runs are green.
  • Case 9 as a declared extra: within scope, accepted. The claim's file surface names the eval fixtures "for ask_ai", and case 9 is the knowledge-split case, so read strictly it sits outside. It is accepted because it is one phrase in the same file ("no chunkSize" became "no chunk-size key"), the meaning is unchanged, the assertions are untouched, and both the PR body and the changeset declare it. Splitting it out would cost a card for a one-phrase edit.
  • Out-of-scope notes (the ai_context teaching stays on 37140 跟进:技能文档教作者写资料包(ai_context) #37177; the objectstack-ui row already landed): both correct.
  • SQL push-down: not applicable. The diff holds no code, no query and no id materialisation.
  • Token ceiling: the row was not raised, so the enumeration-row exception in the claim was not used.

④ Design judgment

skills/objectstack-ai/SKILL.md: holds against the spec on main and against the card's four points. An agent given the card's prompt and this text writes an action that parses. No must-fix.

skills/objectstack-ai/evals/skills-tools-knowledge.json:

  • S2: closed. Case 10's must_not_contain is now ["target:"], and its reference answer no longer carries a forbidden token. Case 9's reference no longer spells chunkSize.
  • The quoted grader output is credible. gradeAnswer in packages/qa/scenarios/src/skill-evals/grade.ts is two String.includes filters. Applying the same rule to each case's expected_output reproduces the PR body exactly: at e16ec49 case 9 carries chunkSize and case 10 carries exposed: true (and only that one of its three forbidden tokens); at 05555e0 all ten cases have nothing missing and nothing forbidden.
  • nit. Case 10 lost some teeth. It no longer fails an answer that writes ai: { exposed: true } on an ask_ai action, one of the two wrong forms the PR's own "Why" names. That is the honest price of a literal-substring grader, which cannot tell the key in code from the same words in a sentence stating the refusal. What remains still does work: target: catches the other wrong form, and must_contain: ask_ai fails the commoner wrong answer, an exposed script action. No change asked.
  • nit. The PR body says the case 9 edit was "asked for in the contract review". The earlier record named case 9 as precedent with the same flaw; it did not ask for the fix. The edit is welcome either way.

.changeset/37217-skill-ask-ai-action.md: accurate, including the new sentences on case 10 and case 9.

Implemented-by: claude/project-thread-cfxhbj
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Approval requested (Tier H, skills/**; Security-touching: yes). Seat ACCEPT: comment 7179183529. Contract review PASS at CONTRACT_REVIEW_TIER: comment 7179228666, Head-sha 05555e04f3298c989234451bc030e19ab3361236. After approval the seat lands it.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 26, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 26, 2026 00:55
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 1f939b1 Nov 26, 2026
59 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-cfxhbj branch November 26, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue security size/s tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

37142 跟进:AI 技能文档教作者放「问 AI」按钮(ask_ai 动作)

2 participants